﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;

namespace hzGis.service.impl
{
   public class AnalysisService
    {
       public List<IFeature> spaceAnalysis(IGeometry pGeometry, IFeatureClass pFeatureClass, esriSpatialRelEnum spatialRel){
           List<IFeature> features = new List<IFeature>();
           //创建属性查询
           ISpatialFilter pSpatialFilter = new SpatialFilter()
           {
               Geometry = pGeometry,   //设置查询几何
               SpatialRel = spatialRel, //设置查询的空间关系
           };
           IFeatureCursor pFeatureCursor = pFeatureClass.Search(pSpatialFilter, false);
           IFeature pFeature = null;
           while ((pFeature = pFeatureCursor.NextFeature()) != null)
           {
               // 这里依据pGeometry进行分割
               features.Add(pFeature);
           }
           return features;
       }
    }
}
